/********************************************************************
	created:	2006/01/05
	created:	5:1:2006   13:46
	file base:	dapdef
	file ext:	h
	author:		Albert Gu
	
	purpose:	common routine & head file define
*********************************************************************/
#ifndef _DAPCOMMON_H
#define _DAPCOMMON_H

#ifndef _LINUX_OS_
#pragma warning(disable : 4786)
#endif
//////////////////////////////////////////////////////////////////////////
//STL head include
#include <string>
#include <numeric>
#include <vector>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <iterator>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <ctime>
//////////////////////////////////////////////////////////////////////////
//Own head include
#include <cassert>
//////////////////////////////////////////////////////////////////////////
#ifdef _LINUX_OS_
#include <pthread.h>
#define DAPAPI extern
typedef const char* LPCTSTR;
#else
#ifdef _DAP_COREDLL
#define DAPAPI __declspec(dllexport)
#else
#define DAPAPI __declspec(dllimport)
#endif
#endif

#ifndef NULL
#define NULL 0
#endif
//////////////////////////////////////////////////////////////////////////
typedef unsigned char byte;
typedef byte binary;
typedef unsigned long DWORD;

inline char mkupper(char c) {return (char)toupper(c);}; 
inline char mklower(char c) {return (char)tolower(c);};
//////////////////////////////////////////////////////////////////////////
DAPAPI void TrimLeft(std::string& str, char c = 0x20);
DAPAPI void TrimRight(std::string& str, char c = 0x20);
DAPAPI void Replace(std::string& strSrc, const char* lpszSrc, const char* lpszTar);
DAPAPI void ReplaceEscape(std::string& str, bool bGet = true);
#endif //_DAPCOMMON_H
